<!DOCTYPE html><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<meta charset="utf-8">
<title>phpDocumentor » \robot_environment</title>
<meta name="author" content="Mike van Riel">
<meta name="description" content="">
<link href="../css/template.css" rel="stylesheet" media="all">
<script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script><script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script><script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script><script src="../js/bootstrap.js" type="text/javascript"></script><script src="../js/template.js" type="text/javascript"></script><script src="../js/prettify/prettify.min.js" type="text/javascript"></script><link rel="shortcut icon" href="../img/favicon.ico">
<link rel="apple-touch-icon" href="../img/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png">
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner"><div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">phpDocumentor</a><div class="nav-collapse"><ul class="nav">
<li class="dropdown">
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
                                    API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
<li><a>Packages</a></li>
<li><a href="../packages/api.html"><i class="icon-folder-open"></i> api</a></li>
<li><a href="../packages/css.html"><i class="icon-folder-open"></i> css</a></li>
<li><a href="../packages/img.html"><i class="icon-folder-open"></i> img</a></li>
<li><a href="../packages/inc.html"><i class="icon-folder-open"></i> inc</a></li>
<li><a href="../packages/js.html"><i class="icon-folder-open"></i> js</a></li>
</ul>
</li>
<li class="dropdown" id="charts-menu">
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
                                    Charts <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="../graph_class.html"><i class="icon-list-alt"></i> Class hierarchy diagram</a></li></ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#reports" class="dropdown-toggle" data-toggle="dropdown">
                                    Reports <b class="caret"></b></a><ul class="dropdown-menu">
<li><a href="../errors.html"><i class="icon-remove-sign"></i> Errors 
                <span class="label label-info">0</span></a></li>
<li><a href="../markers.html"><i class="icon-map-marker"></i> Markers 
                <ul></ul></a></li>
<li><a href="../deprecated.html"><i class="icon-stop"></i> Deprecated elements 
                <span class="label label-info">0</span></a></li>
</ul>
</li>
</ul></div>
</div></div>
<div class="go_to_top"><a href="#___" style="color: inherit">Back to top  <i class="icon-upload icon-white"></i></a></div>
</div>
<div id="___" class="container">
<noscript><div class="alert alert-warning">
                            Javascript is disabled; several features are only available
                            if Javascript is enabled.
                        </div></noscript>
<div class="row">
<div class="span4">
<span class="btn-group visibility" data-toggle="buttons-checkbox"><button class="btn public active" title="Show public elements">Public</button><button class="btn protected" title="Show protected elements">Protected</button><button class="btn private" title="Show private elements">Private</button><button class="btn inherited active" title="Show inherited elements">Inherited</button></span><div class="btn-group view pull-right" data-toggle="buttons-radio">
<button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button><button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button>
</div>
<ul class="side-nav nav nav-list">
<li class="nav-header">
<i class="icon-custom icon-method"></i> Methods
                    <ul>
<li class="method public "><a href="#method___construct" title="__construct :: Creates a robot_environment using the given information."><span class="description">Creates a robot_environment using the given information.</span><pre>__construct()</pre></a></li>
<li class="method public "><a href="#method_authorized" title="authorized :: Checks if the current user is authorized for this interface/environment."><span class="description">Checks if the current user is authorized for this interface/environment.</span><pre>authorized()</pre></a></li>
<li class="method public "><a href="#method_create_head" title="create_head :: Create common parts of the HTML head section."><span class="description">Create common parts of the HTML head section.</span><pre>create_head()</pre></a></li>
<li class="method public "><a href="#method_create_study_head" title="create_study_head :: Create common parts of the HTML head section for a study session."><span class="description">Create common parts of the HTML head section for a study session.</span><pre>create_study_head()</pre></a></li>
<li class="method public "><a href="#method_get_envid" title="get_envid :: Get the environment ID for the associated environment."><span class="description">Get the environment ID for the associated environment.</span><pre>get_envid()</pre></a></li>
<li class="method public "><a href="#method_get_experiment" title="get_experiment :: Get the experiment SQL entry found for the user, or null if none exist."><span class="description">Get the experiment SQL entry found for the user, or null if none exist.</span><pre>get_experiment()</pre></a></li>
<li class="method public "><a href="#method_get_intid" title="get_intid :: Get the interface ID for the associated interface."><span class="description">Get the interface ID for the associated interface.</span><pre>get_intid()</pre></a></li>
<li class="method public "><a href="#method_get_mjpeg" title="get_mjpeg :: Get the MJPEG server host name."><span class="description">Get the MJPEG server host name.</span><pre>get_mjpeg()</pre></a></li>
<li class="method public "><a href="#method_get_mjpegport" title="get_mjpegport :: Get the MJPEG server port."><span class="description">Get the MJPEG server port.</span><pre>get_mjpegport()</pre></a></li>
<li class="method public "><a href="#method_get_user_account" title="get_user_account :: Get the user account SQL array for the user that is currently logged in."><span class="description">Get the user account SQL array for the user that is currently logged in.</span><pre>get_user_account()</pre></a></li>
<li class="method public "><a href="#method_get_widgets_by_name" title="get_widgets_by_name :: Get an array of all widgets for this robot environment/interface with the
given widget name."><span class="description">Get an array of all widgets for this robot environment/interface with the
given widget name.</span><pre>get_widgets_by_name()</pre></a></li>
<li class="method public "><a href="#method_rosbridge_url" title="rosbridge_url :: Get the full rosbridge websocket URL as a string."><span class="description">Get the full rosbridge websocket URL as a string.</span><pre>rosbridge_url()</pre></a></li>
</ul>
</li>
<li class="nav-header">
<i class="icon-custom icon-property"></i> Properties
                    <ul></ul>
</li>
<li class="nav-header private">» Private
                    <ul>
<li class="property private "><a href="#property__environment" title="$_environment :: The environment SQL array for the current environment."><span class="description"></span><pre>$_environment</pre></a></li>
<li class="property private "><a href="#property__experiment" title="$_experiment :: The experiment SQL entry for any valid experiments found for the given
user at this time."><span class="description"></span><pre>$_experiment</pre></a></li>
<li class="property private "><a href="#property__interface" title="$_interface :: The interface SQL array for the current interface."><span class="description"></span><pre>$_interface</pre></a></li>
<li class="property private "><a href="#property__userAccount" title="$_userAccount :: The user account SQL array for the current user."><span class="description"></span><pre>$_userAccount</pre></a></li>
<li class="property private "><a href="#property__widgets" title="$_widgets :: The array of arrays of SQL widget entries."><span class="description"></span><pre>$_widgets</pre></a></li>
</ul>
</li>
</ul>
</div>
<div class="span8">
<a id="\robot_environment"></a><ul class="breadcrumb">
<li>
<a href="../index.html"><i class="icon-custom icon-class"></i></a><span class="divider">\</span>
</li>
<li><a href="../namespaces/global.html">global</a></li>
<li class="active">
<span class="divider">\</span><a href="../classes/robot_environment.html">robot_environment</a>
</li>
</ul>
<div class="element class">
<p class="short_description">The robot_environment class contains useful functions for gaining access to
useful information such as widget lists, etc.</p>
<div class="details">
<div class="long_description"></div>
<table class="table table-bordered">
<tr>
<th>author</th>
<td><a href="mailto:rctoris@wpi.edu">Russell Toris</a></td>
</tr>
<tr>
<th>copyright</th>
<td>2013 Russell Toris, Worcester Polytechnic Institute</td>
</tr>
<tr>
<th>license</th>
<td><a href="">BSD -- see LICENSE file</a></td>
</tr>
<tr>
<th>version</th>
<td>April, 13 2013</td>
</tr>
<tr>
<th>package</th>
<td><a href="../packages/api.robot.environments.html">api.robot_environments</a></td>
</tr>
</table>
<h3>
<i class="icon-custom icon-method"></i> Methods</h3>
<a id="method___construct"></a><div class="element clickable method public method___construct" data-toggle="collapse" data-target=".method___construct .collapse">
<h2>Creates a robot_environment using the given information.</h2>
<pre>__construct(integer $userid, integer $envid, integer $intid) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$userid</h4>
<code>integer</code><p>The ID of the currently logged in user</p></div>
<div class="subelement argument">
<h4>$envid</h4>
<code>integer</code><p>The ID of the environment to use</p></div>
<div class="subelement argument">
<h4>$intid</h4>
<code>integer</code><p>The ID of the interface to use</p></div>
</div></div>
</div>
<a id="method_authorized"></a><div class="element clickable method public method_authorized" data-toggle="collapse" data-target=".method_authorized .collapse">
<h2>Checks if the current user is authorized for this interface/environment.</h2>
<pre>authorized() : boolean</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>An authorized user is either an admin or a regular user how has a valid
experiment session now.</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>boolean</code>If the current user is authorized for this
    interface/environment</div>
</div></div>
</div>
<a id="method_create_head"></a><div class="element clickable method public method_create_head" data-toggle="collapse" data-target=".method_create_head .collapse">
<h2>Create common parts of the HTML head section.</h2>
<pre>create_head() </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"><p>This includes metadata,
common RMS CSS files and a custom style.css class if it exists in the
interface. All HTML will be echoed.</p></div></div></div>
</div>
<a id="method_create_study_head"></a><div class="element clickable method public method_create_study_head" data-toggle="collapse" data-target=".method_create_study_head .collapse">
<h2>Create common parts of the HTML head section for a study session.</h2>
<pre>create_study_head() </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"><p>If the
current user has a  valid experiment at this time, this function will
create three JavaScript global variables. The first, _EXPID, contains the
experiment ID number for this user. The second, _TIME, is the time
remaining in microseconds remaining in their session at the time the page
was loaded. The final, _END, is the interval ID for the JavaScript time
user to indicate the session is over. This will go off in _TIME
microseconds and will call a function called 'endStudy' if one exists.
All HTML will be echoed and should be placed in the HEAD section. If no
valid experiment is found for this user, nothing will be echoed.</p></div></div></div>
</div>
<a id="method_get_envid"></a><div class="element clickable method public method_get_envid" data-toggle="collapse" data-target=".method_get_envid .collapse">
<h2>Get the environment ID for the associated environment.</h2>
<pre>get_envid() : integer</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Returns</h3>
<div class="subelement response">
<code>integer</code>The environment ID</div>
</div></div>
</div>
<a id="method_get_experiment"></a><div class="element clickable method public method_get_experiment" data-toggle="collapse" data-target=".method_get_experiment .collapse">
<h2>Get the experiment SQL entry found for the user, or null if none exist.</h2>
<pre>get_experiment() : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Returns</h3>
<div class="subelement response">
<code>array</code>the experiment SQL entry found for the user, or null if
    none exist</div>
</div></div>
</div>
<a id="method_get_intid"></a><div class="element clickable method public method_get_intid" data-toggle="collapse" data-target=".method_get_intid .collapse">
<h2>Get the interface ID for the associated interface.</h2>
<pre>get_intid() : integer</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Returns</h3>
<div class="subelement response">
<code>integer</code>The interface ID</div>
</div></div>
</div>
<a id="method_get_mjpeg"></a><div class="element clickable method public method_get_mjpeg" data-toggle="collapse" data-target=".method_get_mjpeg .collapse">
<h2>Get the MJPEG server host name.</h2>
<pre>get_mjpeg() : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Returns</h3>
<div class="subelement response">
<code>string</code>the MJPEG server host name</div>
</div></div>
</div>
<a id="method_get_mjpegport"></a><div class="element clickable method public method_get_mjpegport" data-toggle="collapse" data-target=".method_get_mjpegport .collapse">
<h2>Get the MJPEG server port.</h2>
<pre>get_mjpegport() : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Returns</h3>
<div class="subelement response">
<code>string</code>the MJPEG server port</div>
</div></div>
</div>
<a id="method_get_user_account"></a><div class="element clickable method public method_get_user_account" data-toggle="collapse" data-target=".method_get_user_account .collapse">
<h2>Get the user account SQL array for the user that is currently logged in.</h2>
<pre>get_user_account() : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Returns</h3>
<div class="subelement response">
<code>array</code>the user account SQL array</div>
</div></div>
</div>
<a id="method_get_widgets_by_name"></a><div class="element clickable method public method_get_widgets_by_name" data-toggle="collapse" data-target=".method_get_widgets_by_name .collapse">
<h2>Get an array of all widgets for this robot environment/interface with the
given widget name.</h2>
<pre>get_widgets_by_name(string $name) : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$name</h4>
<code>string</code><p>The name of the widget</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>array</code>The array of widgets for this environment/interface or null
    if none exist</div>
</div></div>
</div>
<a id="method_rosbridge_url"></a><div class="element clickable method public method_rosbridge_url" data-toggle="collapse" data-target=".method_rosbridge_url .collapse">
<h2>Get the full rosbridge websocket URL as a string.</h2>
<pre>rosbridge_url() : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Returns</h3>
<div class="subelement response">
<code>string</code>the full rosbridge websocket URL as a string</div>
</div></div>
</div>
<h3>
<i class="icon-custom icon-property"></i> Properties</h3>
<a id="property__environment"> </a><div class="element clickable property private property__environment" data-toggle="collapse" data-target=".property__environment .collapse">
<h2></h2>
<pre>$_environment : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="property__experiment"> </a><div class="element clickable property private property__experiment" data-toggle="collapse" data-target=".property__experiment .collapse">
<h2></h2>
<pre>$_experiment : array | null</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"><p>This will be set to null if such an experiment does
not exist.</p></div></div></div>
</div>
<a id="property__interface"> </a><div class="element clickable property private property__interface" data-toggle="collapse" data-target=".property__interface .collapse">
<h2></h2>
<pre>$_interface : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="property__userAccount"> </a><div class="element clickable property private property__userAccount" data-toggle="collapse" data-target=".property__userAccount .collapse">
<h2></h2>
<pre>$_userAccount : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="property__widgets"> </a><div class="element clickable property private property__widgets" data-toggle="collapse" data-target=".property__widgets .collapse">
<h2></h2>
<pre>$_widgets : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"><p>The first array is indexed by
widget name. The inner array is indexed only by numbers.</p></div></div></div>
</div>
</div>
</div>
</div>
</div>
<div class="row"><footer class="span12">
            Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
            Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a12</a> and<br>
            generated on 2013-04-16T13:14:58-07:00.<br></footer></div>
</div>
</body>
</html>
